package com.hsnn.medstgmini.base.dict.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.hsnn.medstgmini.model.Status;
import com.hsnn.medstgmini.util.DateUtil;
/**
 * @category 自定义字典 
 * @author zhangj
 * @date 2015-06-09
 */
@Entity
@Table(name = "dic_sysdic")
public class DicSys implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields

	private String sysDicId;
	private String classifyCode;
	private String classifyName;
	private String dicCode;
	private String dicName;
	private String remark;
	private short status;
	private Date updDatetime;
	private String updUser;
	private short sortId;
	
	private String statusName;
	private String updDateTimeStr;

	// Constructors

	/** default constructor */
	public DicSys() {
	}

	/** full constructor */
	public DicSys(String classifyCode, String classifyName, String dicCode,
			String dicName, String remark, short status, Date updDatetime,
			String updUser, short sortId) {
		this.classifyCode = classifyCode;
		this.classifyName = classifyName;
		this.dicCode = dicCode;
		this.dicName = dicName;
		this.remark = remark;
		this.status = status;
		this.updDatetime = updDatetime;
		this.updUser = updUser;
		this.sortId = sortId;
	}

	// Property accessors
	@Id
	@Column(name = "sys_dic_id")
	public String getSysDicId() {
		return this.sysDicId;
	}

	public void setSysDicId(String sysDicId) {
		this.sysDicId = sysDicId;
	}

	@Column(name = "classify_code")
	public String getClassifyCode() {
		return this.classifyCode;
	}

	public void setClassifyCode(String classifyCode) {
		this.classifyCode = classifyCode;
	}

	@Column(name = "classify_name")
	public String getClassifyName() {
		return this.classifyName;
	}

	public void setClassifyName(String classifyName) {
		this.classifyName = classifyName;
	}

	@Column(name = "dic_code")
	public String getDicCode() {
		return this.dicCode;
	}

	public void setDicCode(String dicCode) {
		this.dicCode = dicCode;
	}

	@Column(name = "dic_name")
	public String getDicName() {
		return this.dicName;
	}

	public void setDicName(String dicName) {
		this.dicName = dicName;
	}

	@Column(name = "remark")
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "status")
	public short getStatus() {
		return this.status;
	}

	public void setStatus(short status) {
		this.status = status;
	}

	@Column(name = "upd_datetime")
	public Date getUpdDatetime() {
		
		return this.updDatetime;
	}

	public void setUpdDatetime(Date updDatetime) {
		this.updDatetime = updDatetime;
	}

	@Column(name = "upd_user")
	public String getUpdUser() {
		return this.updUser;
	}

	public void setUpdUser(String updUser) {
		this.updUser = updUser;
	}

	@Column(name = "sort_id")
	public short getSortId() {
		return this.sortId;
	}

	public void setSortId(short sortId) {
		this.sortId = sortId;
	}
	@Transient
	public String getStatusName() {
		statusName = Status.getName(status);
		return statusName;
	}

	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}
	@Transient
	public String getUpdDateTimeStr() {
		if (updDatetime != null) {
			updDateTimeStr = DateUtil.date(updDatetime);
		}
		return updDateTimeStr;
	}

	public void setUpdDateTimeStr(String updDateTimeStr) {
		this.updDateTimeStr = updDateTimeStr;
	}

	@Override
	public String toString() {
		return "DicSys [sysDicId=" + sysDicId + ", classifyCode="
				+ classifyCode + ", classifyName=" + classifyName
				+ ", dicCode=" + dicCode + ", dicName=" + dicName + ", remark="
				+ remark + ", status=" + status + ", updDatetime="
				+ updDatetime + ", updUser=" + updUser + ", sortId=" + sortId
				+ ", statusName=" + statusName + ", updDateTimeStr="
				+ updDateTimeStr + "]";
	}
	
}